/// @tags: DP Count
#include <cstdio>
#include <cstring>
#include <iostream>
#include <vector>

using namespace std;

namespace BlueQuantum {

typedef long long LL;

int const N = 1e5 + 5, mod = 1e9 + 7;

int m, k, lim;
int fac[N], vis[N], inv[N], exp[N];
char str[N];
vector<int> f[N];

inline LL qpow(LL base, int exp) {
  LL res = 1;
  while (exp) {
    if (exp & 1) (res *= base) %= mod;
    exp >>= 1, (base *= base) %= mod;
  }
  return res;
}

inline void prework(int n) {
  for (int i = exp[0] = fac[0] = 1; i <= n; ++i) {
    fac[i] = (LL)fac[i - 1] * i % mod;
    exp[i] = 25LL * exp[i - 1] % mod;
  }
  inv[n] = qpow(fac[n], mod - 2);
  for (int i = n - 1; i >= 0; --i) inv[i] = (LL)inv[i + 1] * (i + 1) % mod;
}

inline LL C(int n, int k) {
  return n < k ? 0 : (LL)fac[n] * inv[k] % mod * inv[n - k] % mod;
}

inline LL calc(int n, int k) { return n >= k ? C(n, k) * exp[n - k] % mod : 0; }

inline int solve(int len) {
  if (!vis[k]) {
    vis[k] = true;
    f[k].push_back(0);
    for (int j = 1; j <= lim; ++j)
      f[k].push_back((calc(j - 1, k - 1) + 26LL * f[k][j - 1] % mod) % mod);
  }
  return f[k][len];
}

inline int main() {
  cin >> m >> str;
  prework(lim = 1e5);
  k = strlen(str);
  for (int i = 1, opt, len; i <= m; ++i) {
    cin >> opt;
    switch (opt) {
      case 1:
        cin >> str, k = strlen(str);
        break;
      case 2:
        cin >> len;
        cout << solve(len) << '\n';
    }
  }
  return 0;
}

}  // namespace BlueQuantum

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("/tmp/CodeTmp/testdata.in", "r", stdin);
  freopen("/tmp/CodeTmp/testdata.out", "w", stdout);
#else
  freopen("CF666C Codeword.in", "r", stdin);
  freopen("CF666C Codeword.out", "w", stdout);
#endif
#endif

  ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  return BlueQuantum::main();
}
